package com.example.demo.util;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.File;

/**
 * Created by Administrator on 2017-6-26.
 */
public class HtmlUtil {

    public static void parse(String s) {


        try {


            Document doc = Jsoup.parse(s);


            Element content = doc.getElementById("main-panel");
            Element fileList =    content.getElementsByClass("fileList").get(0);
        Elements links = fileList.getElementsByTag("a");
            for (Element link : links) {
                String linkHref = link.attr("href");
                String linkText = link.text();

                System.out.println(linkText);
            }

        }catch (Exception e){

        }
    }
}
